package com.zj.HJ;

import java.util.Scanner;

public class HJ51 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int total = sc.nextInt();
            int[] arr = new int[total];
            for (int i = 0; i < total; i++) {
                arr[i] = sc.nextInt();
            }
            int num = sc.nextInt();
            System.out.println(getRes(arr, num));

        }
    }

    public static int getRes(int[] arr, int num) {
        return arr[arr.length - num];

    }


}
